using System.Collections;
using Rdl;

namespace GTame.ReportParser
{

    public class FilterType
    {

        private string _FilterExpression;
        private FilterValuesType _FilterValues;
        private FilterTypeOperator _Operator;

        public string FilterExpression
        {
            get
            {
                return _FilterExpression;
            }
            set
            {
                _FilterExpression = value;
            }
        }

        public FilterValuesType FilterValues
        {
            get
            {
                if (_FilterValues == null)
                    _FilterValues = new FilterValuesType();
                return _FilterValues;
            }
            set
            {
                _FilterValues = value;
            }
        }

        public FilterTypeOperator Operator
        {
            get
            {
                return _Operator;
            }
            set
            {
                _Operator = value;
            }
        }

        public FilterType()
        {
        }

        public FilterType Write()
        {
            FilterType filterType = new FilterType();
            ArrayList arrayList = new ArrayList();
            if (_FilterExpression != null)
                arrayList.Add(_FilterExpression);
            if (_FilterValues != null)
                arrayList.Add(_FilterValues.Write());
            arrayList.Add(_Operator);
            filterType.Items = arrayList.ToArray();
            arrayList = null;
            return filterType;
        }

    } // class FilterType

}

